<?php

class LoginForm {

	public function getForm() {

		if(isset($_SESSION['user'])) {
			$default = $_SESSION['user'];
		} else {
			$default = "";
		}

		return '<form method="post">
					Username: <input type="text" value="' . $default . '" name="uname" /><br />
					Password: <input type="password" name="pwd" /><br />
					<input type="submit" value="Login" />
					<input type="hidden" name="submitted" value="true" />
				</form>';
	}
}